package com.intretech.umsin.oss.config;

import com.github.tobato.fastdfs.FdfsClientConfig;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.EnableMBeanExport;
import org.springframework.context.annotation.Import;
import org.springframework.jmx.support.RegistrationPolicy;

/**
 * @version V1.0
 * @ClassName: FastDfsOSSConfig
 * @Description: FastDfsOSSConfig 服务实现
 * @author: 李启联
 * @date: 2022-04-25 23:07
 * @Copyright: Copyright (c) 2022
 */
@Configuration
@ConditionalOnProperty(name = "oss-type",havingValue = "FASTDFS",matchIfMissing = false)
@Import(FdfsClientConfig.class) // 导入FastDFS-Client组件
@EnableMBeanExport(registration = RegistrationPolicy.IGNORE_EXISTING) // 解决jmx重复注册bean的问题
public class FastDfsOSSConfig {

    /**
     * nginx安装了fastdfs的地址
     */
    @Value("${fdfs.oss.domain:}")
    private String domain;

    public String getDomain() {
        return domain;
    }

    public void setDomain(String domain) {
        this.domain = domain;
    }
}
